
//
// 130728 - AH - (Created).
//

package org.japril.jutil.pulse.demo;

import org.japril.jutil.pulse.DefaultProduct;
import org.japril.jutil.pulse.Processors;
import org.japril.jutil.pulse.Products;

public final class Tasks 
{
  public static void main(String[] args)
  {
    // Task O: Sets up the sensor and captor, they are Processors 
	// (implements that interface).
	Processors processors=new Processors();
	
	// Note we will not have to make the two know about each other, they will
	// start work when told to and then look for product for type that is for
	// it. Look in the code for Sensor and Captor then one see what make the
	// Processor decide it should work (it look at pulse name) and how it then
	// look for data that is for it.
	processors.addProcessor(new Sensor());  
	processors.addProcessor(new Captor());  
	    
	// Task 1: Initial, setting up initial products, will be to get stuff from
	// the orb and putting them on ORB.
	Products products=new Products();
	products.addProduct(new DefaultProduct("text/xml", "<xml .....>"));
	
	// Task 2: Let the sensor sense.
	products.setPulseName("sense");
	processors.process(products);
	
	// Task 3: Let the captors capture.
	products.setPulseName("capture");
	processors.process(products);
  }
  
}
